<admintpl file="header" />
<link rel="stylesheet" href="__PUBLIC__/css/jquery.datetimepicker.css">
<style type="text/css">
	.hidden{
		display: none;
	}
	img.act_img {
	    height: 60px;
	}
</style>
</head>
<body>
	<div class="wrap">
		<!-- <ul class="nav nav-tabs">
			<li><a href="{:U('ad/index')}">{:L('ADMIN_AD_INDEX')}</a></li>
			<li class="active"><a href="{:U('ad/add')}">{:L('ADMIN_AD_ADD')}</a></li>
		</ul> -->
		<form method="post" class="form-horizontal" action="{:U('Admin/Activites/saveActivite')}" enctype="multipart/form-data">
			<fieldset>
				<div class="control-group">
					<label class="control-label">活动标题</label>
					<div class="controls">
						<input type="text" name="title" value="{$activity['title']}">
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">填写活动链接</label>
					<div class="controls">
						<input type="text" name="link" value="{$activity['link']}">
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">选择城市</label>
					<div class="controls"> 
						<table class="cityList table  table-hover table-bordered table-list" border="1" cellpadding="2" cellspacing="0">
							<tr>
								<td width="80px">城市ID</td>
								<td width="240px">城市名</td>
								<td width="80px">操作</td>
							</tr>
							<volist name="citys" id="city">
								<tr>
									<td width="80px">{$city[cityid]}</td>
									<td width="240px">{$city[name]}</td>
									<td width="80px"><a href="#" class="delCity">删除</a></td>
								</tr>
							</volist>
						</table>
						<br>
						<volist name="citys" id="city">
							<input type="hidden" data-cityid="{$city['cityid']}" name="citys[]" value="{$city['cityid']}"/>
						</volist>

					</div>
					<div class="controls">
						<select name="" id="citySelectList">
							<option value="0">所有城市</option>
							<volist name="citylist" id="city">
								<option value="{$city[cityId]}">{$city['cityName']}</option>
							</volist>
						</select> <br> <br>
						<input type="text" name="citySearch" placeholder="搜索城市">  <button class="citySearch">查询</button><br><br>
						 <button class="addCity">添加</button>
					</div>
					<div class="cityids">
						
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">上线时间</label>
					<div class="controls">
						<input type="text" name="onlineTime" id="onlinetime" value="{$activity['onlineTime']}">
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">下线时间</label>
					<div class="controls">
						<input type="text" name="offlineTime" id="offlinetime" value="{$activity['offlineTime']}">
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">配置活动图片</label>
					<div class="controls">
						375*150图片: <input type="file" name="smallImage">
						<span class="form-required">*</span>
						<img src="{$activity['smallImage']}" class="act_img">
					</div>
					<div class="controls">
						1000*200图片: <input type="file" name="fullImage">
						<span class="form-required">*</span>
						<img src="{$activity['fullImage']}" class="act_img">
					</div>
				</div>
				<input type="hidden" name="id" value="{$activity['id']}">

					<hr class="tools-split">
				<div class="control-group">
					<label class="control-label">分享标题</label>
					<div class="controls">
						<input type="text" name="shareTitle" id="sharetitle" value="{$activity['shareTitle']}">
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">分享描述</label>
					<div class="controls">
						<input type="text" name="shareDesc" id="sharedesc"  value="{$activity['shareDesc']}">
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">分享链接</label>
					<div class="controls">
						<input type="text" name="shareLink" id="sharelink"  value="{$activity['shareLink']}">
						<span class="form-required tips">[默认为活动链接]</span>
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">是否需要登录</label>
					<div class="controls">
						<input type="checkbox" name="islogin" id="islogin" value="1" <notempty name="activity[islogin]"> checked="checked"</notempty>>
						<span class="form-required tips">[仅设置分享时有效]</span>
					</div>
				</div>

				<hr class="tools-split">
				<div class="control-group">
					<label class="control-label">操作类型</label>
					<div class="controls">
						<select name="action">
							<option value="1" <eq name="activity[action]" value="1"> selected="selected"</eq>>跳转到商户详情页</option>
							<option value="2" <eq name="activity[action]" value="2"> selected="selected"</eq>>跳转到商户列表页</option>
							<option value="6" <eq name="activity[action]" value="6"> selected="selected"</eq>>跳转到排队取号页</option>
							<option value="7" <eq name="activity[action]" value="7"> selected="selected"</eq>>跳转到预约订座页</option>
						</select>
						<span class="form-required tips">[分享标题设置时，该设置不生效]</span>
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">选择城市</label>
					<div class="controls">
						<select name="" id="citySelectList_2">
							<option value="0">所有城市</option>
							<volist name="citylist" id="city">
								<option value="{$city[cityId]}">{$city['cityName']}</option>
							</volist>
						</select> <br> <br>
						<input type="text" name="citySearch_2" placeholder="搜索城市(默认上海)">  <button class="citySearch_2">查询</button>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">商家名称</label>
					<div class="controls">
						<input type="text" name="searchName" id="shopname">
						<button class="shopSearch">查询</button>
						<select name="shopid" id="shop_list">
							<option value="0">不设置广告商家</option>
							<notempty name="activity[shopName]">
							<option value="{$activity[shopid]}" data-manage-shopid="{$activity[manageShopId]}" selected="selected">{$activity[shopName]}</option>
							</notempty>
						</select>
						<input type="hidden" name="manageShopId" value="{$activity[manageShopId]}">
						<input type="hidden" name="shopName" value="{$activity[shopName]}">
						<span class="form-required tips"></span>
					</div>
				</div>

			</fieldset>
			<div class="form-actions">
				<button type="submit" class="btn btn-primary js-ajax-submit">{:L('ADD')}</button>
				<a class="btn" href="{:U('Activites/listActivite')}">{:L('BACK')}</a>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
  <script src="__PUBLIC__/js/laydate.js"></script>
  <script src="__PUBLIC__/js/activity/act.js"></script>
  <script>
  $(function(){
  		$('#onlinetime').click(function(){
  			laydate({elem: '#onlinetime',format: 'YYYY/MM/DD hh:mm',istime: true});
  		});
  		$('#offlinetime').click(function(){
  			laydate({elem: '#offlinetime',format: 'YYYY/MM/DD hh:mm',istime: true});
  		});
  });

  </script>
</body>
</html>